using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Danser_Control.Exceptions;

namespace Danser_AJAXEnabledWebApplication.Faults
{
    /// <summary>
    /// Page to display an authorization violation occured while attempting to request a non authorized page
    /// </summary>
    public partial class UnAuthorizedAccess : System.Web.UI.Page
    {
        /// <summary>
        /// Keys used to save in session the system error occured during executing the request
        /// </summary>
        public const String SESSION_ERROR_KEY = "AuthorizationError";
        /// <summary>
        /// the session URL key
        /// </summary>
        public const String SESSION_ERROR_URL_KEY = "~/Faults/UnAuthorizedAccess.aspx";
        
        /// <summary>
        /// loads the page...
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            DanserAuthorizationException exception = 
                Session[SESSION_ERROR_KEY] as DanserAuthorizationException;

            causedByLiteral.Text = exception.Message;
        }
    }
}
